﻿#include "FITKAcousticsLoadMgrAdaptor.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsAbsNCT.h"
#include "FITKAcousticsHDF5Writer.h"
#include "FITKAcousticsHDF5Reader.h"
#include "FITK_Interface/FITKInterfaceIO/FITKHDF5FileTool.h"

#include"FITK_Component/FITKAcousticsPhysics/FITKAcousticsAbstractLoad.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsLoadManager.h"

//子类
#include "FITK_Component/FITKAcousticsPhysics/FITKLoadNoiseHVAC.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKLoadConstraintSEABeam.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKLoadConstraintSEAShell.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKLoadConstraintSEAAcoustic.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKLoadPowerSourcesSEABeam.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKLoadPowerSourcesSEAShell.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKLoadPowerSourcesSEAAcoustic.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKLoadExcitationForceMoments.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKLoadExcitationMonopole.h"




bool IO::FITKAcousticsLoadMgrAdaptor::adaptR()
{
    Acoustics::FITKAcousticsLoadManager* LoadManager =
        dynamic_cast<Acoustics::FITKAcousticsLoadManager*>(_dataObj);
    if (LoadManager == nullptr || _reader == nullptr) return false;
    m_toolp = _reader->getHDF5FileTool();//初始化工具

    std::tuple<bool, H5::Group>Ret = m_toolp->openGp("Load");//打开载荷
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group LoadGroup = std::get<1>(Ret);

    bool ImportNoiseHVACsRet = false;
    bool ConstraintSEABeamRet = false;
    bool ConstraintSEAShellRet = false;
    bool ConstraintSEAAcousticRet = false;
    bool PowerSEABeamRet = false;
    bool PowerSEAShellRet = false;
    bool PowerSEAAcousticRet = false;
    bool ExcitationForceMomentsRet = false;
    bool ExcitationMonopolesRet = false;


    ImportNoiseHVACsRet = this->readImportNoiseHVACs(LoadGroup, LoadManager);
    ConstraintSEABeamRet = this->readConstraintSEABeam(LoadGroup, LoadManager);
    ConstraintSEAShellRet = this->readConstraintSEAShell(LoadGroup, LoadManager);
    ConstraintSEAAcousticRet = this->readConstraintSEAAcoustic(LoadGroup, LoadManager);
    PowerSEABeamRet = this->readPowerSEABeam(LoadGroup, LoadManager);
    PowerSEAShellRet = this->readPowerSEAShell(LoadGroup, LoadManager);
    PowerSEAAcousticRet = this->readPowerSEAAcoustic(LoadGroup, LoadManager);
    ExcitationForceMomentsRet = this->readExcitationForceMoments(LoadGroup, LoadManager);
    ExcitationMonopolesRet = this->readExcitationMonopoles(LoadGroup, LoadManager);

    return ImportNoiseHVACsRet && ConstraintSEABeamRet&&
        ConstraintSEAShellRet&&ConstraintSEAAcousticRet
        &&PowerSEAShellRet&&PowerSEAShellRet
        &&PowerSEAAcousticRet&&ExcitationForceMomentsRet
        &&ExcitationMonopolesRet;
}

bool IO::FITKAcousticsLoadMgrAdaptor::adaptW()
{
    Acoustics::FITKAcousticsLoadManager* LoadManager =
        dynamic_cast<Acoustics::FITKAcousticsLoadManager*>(_dataObj);
    if (LoadManager == nullptr || _writer == nullptr) return false;
    m_toolp = _writer->getHDF5FileTool();//初始化工具

    QList<Acoustics::FITKAcousticsAbstractLoad*> ImportNoiseHVACs = LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::ImportNoiseHVAC);//HVAC噪声导入
    QList<Acoustics::FITKAcousticsAbstractLoad*> ConstraintSEABeams = LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::ConstraintSEABeam);//SEA梁约束
    QList<Acoustics::FITKAcousticsAbstractLoad*> ConstraintSEAShells = LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::ConstraintSEAShell);//SEA板约束
    QList<Acoustics::FITKAcousticsAbstractLoad*> ConstraintSEAAcoustics = LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::ConstraintSEAAcoustic);//SEA声腔约束
    //LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::ConstraintFESubsys);//FE子系统约束
    QList<Acoustics::FITKAcousticsAbstractLoad*> PowerSEABeams = LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::PowerSEABeam);//SEA梁功率源
    QList<Acoustics::FITKAcousticsAbstractLoad*> PowerSEAShells = LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::PowerSEAShell);// SEA板功率源
    QList<Acoustics::FITKAcousticsAbstractLoad*> PowerSEASEAAcoustic = LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::PowerSEAAcoustic);// SEA声腔功率源
    //LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::PowerFESubsys);// FE子系统功率源
    QList<Acoustics::FITKAcousticsAbstractLoad*> ExcitationForceMoments = LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::ExcitationForceMoments);//力和力矩激励
    QList<Acoustics::FITKAcousticsAbstractLoad*> ExcitationMonopoles = LoadManager->getLoadByType(Acoustics::FITKAcousticsAbstractLoad::AcousticsLoadType::ExcitationMonopole);// 单极子


    std::tuple<bool, H5::Group> Ret = m_toolp->createGp("Load");     //创建载荷组
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group LoadGroup = std::get<1>(Ret);

    bool ImportNoiseHVACsRet = false;
    bool ConstraintSEABeamRet = false;
    bool ConstraintSEAShellRet = false;
    bool ConstraintSEAAcousticRet = false;
    bool PowerSEABeamRet = false;
    bool PowerSEAShellRet = false;
    bool PowerSEAAcousticRet = false;
    bool ExcitationForceMomentsRet = false;
    bool ExcitationMonopolesRet = false;

    ImportNoiseHVACsRet = this->writeImportNoiseHVACs(LoadGroup, ImportNoiseHVACs);//HVAC噪声导入
    ConstraintSEABeamRet = this->writeConstraintSEABeam(LoadGroup, ConstraintSEABeams);//SEA梁约束
    ConstraintSEAShellRet = this->writeConstraintSEAShell(LoadGroup, ConstraintSEAShells);//SEA板约束
    ConstraintSEAAcousticRet = this->writeConstraintSEAAcoustic(LoadGroup, ConstraintSEAAcoustics);//SEA声腔约束
    //this->writeFE子系统约束不写，后续再写
    PowerSEABeamRet = this->writePowerSEABeam(LoadGroup, PowerSEABeams);//SEA梁功率源
    PowerSEAShellRet = this->writePowerSEAShell(LoadGroup, PowerSEAShells);//SEA板功率源
    PowerSEAAcousticRet = this->writePowerSEAAcoustic(LoadGroup, PowerSEASEAAcoustic);//SEA声腔功率
    ExcitationForceMomentsRet = this->writeExcitationForceMoments(LoadGroup, ExcitationForceMoments);//力和力矩激励
    ExcitationMonopolesRet = this->writeExcitationMonopoles(LoadGroup, ExcitationMonopoles);//单极子

    return ImportNoiseHVACsRet && ConstraintSEABeamRet&&
        ConstraintSEAShellRet&&PowerSEABeamRet&&
        PowerSEAShellRet&&PowerSEAAcousticRet&&
        ExcitationForceMomentsRet&&ExcitationMonopolesRet;
}

bool IO::FITKAcousticsLoadMgrAdaptor::readExcitationMonopoles(H5::Group & gp, Acoustics::FITKAcousticsLoadManager * LoadManager)
{
    if (LoadManager == nullptr)
    {
        return false;
    }
    std::tuple<bool, H5::Group>Ret = m_toolp->openGp(gp, "ExcitationMonopoles");//打开组
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group thisGroup = std::get<1>(Ret);

    std::tuple<bool, H5::Attribute>RetAttr = m_toolp->openAttribut(thisGroup, "ExcitationMonopolesCount"); //打开组个数属性
    if (std::get<0>(RetAttr) == false) { return false; }
    H5::Attribute CountAttrattr = std::get<1>(RetAttr);
    int count = -1;
    CountAttrattr.read(H5::PredType::NATIVE_INT, &count);


    for (int i = 0; i < count; ++i)
    {
        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->openGp(thisGroup, number.toStdString().data());//打开子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKLoadExcitationMonopole* ObjP = new Acoustics::FITKLoadExcitationMonopole;
        if (ObjP == nullptr)
        {
            return false;
        }
        //读父类数据
        this->readAcousticsAbstractLoad(subGroup, ObjP);

        //读子类数据
        int SpectraDataID = -1;//频谱ID
        m_toolp->readGroupint(subGroup, "SpectraDataID", &SpectraDataID);
        ObjP->setSpectraDataID(SpectraDataID);

        LoadManager->appendDataObj(ObjP);
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::writeExcitationMonopoles(H5::Group & gp, QList<Acoustics::FITKAcousticsAbstractLoad*> data)
{
    const char *Path = "Load/ExcitationMonopoles";

    int count = data.size();//获取数据行数

    //在组下创建组，并为组附加数据个数属性
    m_toolp->CreateGroupAndAttr(gp, "ExcitationMonopoles", "ExcitationMonopolesCount", count);

    //获取刚刚创建的组
    H5::Group thisGroup = m_toolp->GetPathGroup(Path);

    for (int i = 0; i < count; ++i)
    {
        Acoustics::FITKLoadExcitationMonopole* ObjP = dynamic_cast<Acoustics::FITKLoadExcitationMonopole*>(data.at(i));
        if (ObjP == nullptr)
        {
            return false;
        }

        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->createGp(thisGroup, number.toStdString().data());//创建子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        //父类数据
        Acoustics::FITKAcousticsAbstractLoad* ObjParentP = dynamic_cast<Acoustics::FITKAcousticsAbstractLoad*>(ObjP);
        if (ObjParentP == nullptr)
        {
            return false;
        }
        this->writeAcousticsAbstractLoad(subGroup, ObjParentP);

        //本类数据
        int SpectraDataID = ObjP->getSpectraDataID();//频谱ID
        m_toolp->writeGroupAttrInt(subGroup, "SpectraDataID", SpectraDataID);

    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::readExcitationForceMoments(H5::Group & gp, Acoustics::FITKAcousticsLoadManager * LoadManager)
{
    if (LoadManager == nullptr)
    {
        return false;
    }
    std::tuple<bool, H5::Group>Ret = m_toolp->openGp(gp, "ExcitationForceMoments");//打开组
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group thisGroup = std::get<1>(Ret);

    std::tuple<bool, H5::Attribute>RetAttr = m_toolp->openAttribut(thisGroup, "ExcitationForceMomentsCount"); //打开组个数属性
    if (std::get<0>(RetAttr) == false) { return false; }
    H5::Attribute CountAttrattr = std::get<1>(RetAttr);
    int count = -1;
    CountAttrattr.read(H5::PredType::NATIVE_INT, &count);


    for (int i = 0; i < count; ++i)
    {
        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->openGp(thisGroup, number.toStdString().data());//打开子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKLoadExcitationForceMoments* ObjP = new Acoustics::FITKLoadExcitationForceMoments;
        if (ObjP == nullptr)
        {
            return false;
        }
        //读父类数据
        this->readAcousticsAbstractLoad(subGroup, ObjP);

        //读子类数据
        bool IndirectRadiation = false;//间接辐射启用状态
        int ForceSpectraID = -1;//力谱ID
        int MomentSpectraID = -1;//力矩谱ID

        m_toolp->readGroupBool(subGroup, "IndirectRadiation", &IndirectRadiation);
        m_toolp->readGroupint(subGroup, "ForceSpectraID", &ForceSpectraID);
        m_toolp->readGroupint(subGroup, "MomentSpectraID", &MomentSpectraID);

        ObjP->setIndirectRadiation(IndirectRadiation);
        ObjP->setForceSpectraID(ForceSpectraID);
        ObjP->setMomentSpectraID(MomentSpectraID);


        double ForceOrientation[3] = { 0.0,0.0,0.0 };
        double OffsetValue[3] = { 0.0,0.0,0.0 };
        double MomentOrientation[3] = { 0.0,0.0,0.0 };

        std::vector<double>temp;//存储xyz的临时变量

        temp.clear();
        m_toolp->ReadOneDArrayDataSetDouble(subGroup, "ForceOrientation", temp);
        ForceOrientation[0] = temp.at(0);
        ForceOrientation[1] = temp.at(1);
        ForceOrientation[2] = temp.at(2);

        temp.clear();
        m_toolp->ReadOneDArrayDataSetDouble(subGroup, "OffsetValue", temp);
        OffsetValue[0] = temp.at(0);
        OffsetValue[1] = temp.at(1);
        OffsetValue[2] = temp.at(2);

        temp.clear();
        m_toolp->ReadOneDArrayDataSetDouble(subGroup, "MomentOrientation", temp);
        MomentOrientation[0] = temp.at(0);
        MomentOrientation[1] = temp.at(1);
        MomentOrientation[2] = temp.at(2);

        ObjP->setMomentOrientationVec(MomentOrientation);// 力矩方向{x,y,z}
        ObjP->setOffsetValue(OffsetValue);//偏移量{x,y,z}
        ObjP->setForceOrientationVec(ForceOrientation);//力方向{x,y,z}

        int FENodeID = -1;//节点ID
        m_toolp->readGroupint(subGroup, "FENodeID", &FENodeID);
        ObjP->setFENodeID(FENodeID);

        LoadManager->appendDataObj(ObjP);
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::writeExcitationForceMoments(H5::Group & gp, QList<Acoustics::FITKAcousticsAbstractLoad*> data)
{
    const char *Path = "Load/ExcitationForceMoments";

    int count = data.size();//获取数据行数

    //在组下创建组，并为组附加数据个数属性
    m_toolp->CreateGroupAndAttr(gp, "ExcitationForceMoments", "ExcitationForceMomentsCount", count);

    //获取刚刚创建的组
    H5::Group thisGroup = m_toolp->GetPathGroup(Path);

    for (int i = 0; i < count; ++i)
    {
        Acoustics::FITKLoadExcitationForceMoments* ObjP = dynamic_cast<Acoustics::FITKLoadExcitationForceMoments*>(data.at(i));
        if (ObjP == nullptr)
        {
            return false;
        }

        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->createGp(thisGroup, number.toStdString().data());//创建子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        //父类数据
        Acoustics::FITKAcousticsAbstractLoad* ObjParentP = dynamic_cast<Acoustics::FITKAcousticsAbstractLoad*>(ObjP);
        if (ObjParentP == nullptr)
        {
            return false;
        }
        this->writeAcousticsAbstractLoad(subGroup, ObjParentP);

        //本类数据
        bool IndirectRadiation = ObjP->getIndirectRadiation();//间接辐射启用状态
        int ForceSpectraID = ObjP->getForceSpectraID();//力谱ID
        int MomentSpectraID = ObjP->getMomentSpectraID();//力矩谱ID

        double ForceOrientation[3] = { 0.0,0.0,0.0 };
        double OffsetValue[3] = { 0.0,0.0,0.0 };
        double MomentOrientation[3] = { 0.0,0.0,0.0 };
        ObjP->getMomentOrientationVec(MomentOrientation);// 力矩方向{x,y,z}
        ObjP->getOffsetValue(OffsetValue);//偏移量{x,y,z}
        ObjP->getForceOrientationVec(ForceOrientation);//力方向{x,y,z}

        std::vector<double>temp;//存储xyz的临时变量

        int FENodeID = ObjP->getFENodeID();//节点ID


        m_toolp->writeGroupAttrBool(subGroup, "IndirectRadiation", IndirectRadiation);
        m_toolp->writeGroupAttrInt(subGroup, "ForceSpectraID", ForceSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "MomentSpectraID", MomentSpectraID);

        temp.clear();
        temp.push_back(ForceOrientation[0]);
        temp.push_back(ForceOrientation[1]);
        temp.push_back(ForceOrientation[2]);
        m_toolp->CreateOneDarrayDataSetDouble(subGroup, "ForceOrientation", temp);

        temp.clear();
        temp.push_back(OffsetValue[0]);
        temp.push_back(OffsetValue[1]);
        temp.push_back(OffsetValue[2]);
        m_toolp->CreateOneDarrayDataSetDouble(subGroup, "OffsetValue", temp);

        temp.clear();
        temp.push_back(MomentOrientation[0]);
        temp.push_back(MomentOrientation[1]);
        temp.push_back(MomentOrientation[2]);
        m_toolp->CreateOneDarrayDataSetDouble(subGroup, "MomentOrientation", temp);

        m_toolp->writeGroupAttrInt(subGroup, "FENodeID", FENodeID);
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::readPowerSEAAcoustic(H5::Group & gp, Acoustics::FITKAcousticsLoadManager * LoadManager)
{
    if (LoadManager == nullptr)
    {
        return false;
    }
    std::tuple<bool, H5::Group>Ret = m_toolp->openGp(gp, "PowerSEAAcoustic");//打开组
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group thisGroup = std::get<1>(Ret);

    std::tuple<bool, H5::Attribute>RetAttr = m_toolp->openAttribut(thisGroup, "PowerSEAAcousticCount"); //打开组个数属性
    if (std::get<0>(RetAttr) == false) { return false; }
    H5::Attribute CountAttrattr = std::get<1>(RetAttr);
    int count = -1;
    CountAttrattr.read(H5::PredType::NATIVE_INT, &count);


    for (int i = 0; i < count; ++i)
    {
        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->openGp(thisGroup, number.toStdString().data());//打开子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKLoadPowerSourcesSEAAcoustic* ObjP = new Acoustics::FITKLoadPowerSourcesSEAAcoustic;
        if (ObjP == nullptr)
        {
            return false;
        }
        //读父类数据
        this->readAcousticsAbstractLoad(subGroup, ObjP);

        //读子类数据
        int SpectraDataID = -1;//频谱ID
        m_toolp->readGroupint(subGroup, "SpectraDataID", &SpectraDataID);
        ObjP->setSpectraDataID(SpectraDataID);

        LoadManager->appendDataObj(ObjP);
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::writePowerSEAAcoustic(H5::Group & gp, QList<Acoustics::FITKAcousticsAbstractLoad*> data)
{
    const char *Path = "Load/PowerSEAAcoustic";

    int count = data.size();//获取数据行数

    //在组下创建组，并为组附加数据个数属性
    m_toolp->CreateGroupAndAttr(gp, "PowerSEAAcoustic", "PowerSEAAcousticCount", count);

    //获取刚刚创建的组
    H5::Group thisGroup = m_toolp->GetPathGroup(Path);

    for (int i = 0; i < count; ++i)
    {
        Acoustics::FITKLoadPowerSourcesSEAAcoustic* ObjP = dynamic_cast<Acoustics::FITKLoadPowerSourcesSEAAcoustic*>(data.at(i));
        if (ObjP == nullptr)
        {
            return false;
        }

        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->createGp(thisGroup, number.toStdString().data());//创建子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        //父类数据
        Acoustics::FITKAcousticsAbstractLoad* ObjParentP = dynamic_cast<Acoustics::FITKAcousticsAbstractLoad*>(ObjP);
        if (ObjParentP == nullptr)
        {
            return false;
        }
        this->writeAcousticsAbstractLoad(subGroup, ObjParentP);

        //本类数据
        int SpectraDataID = ObjP->getSpectraDataID();//频谱ID
        m_toolp->writeGroupAttrInt(subGroup, "SpectraDataID", SpectraDataID);

    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::readPowerSEAShell(H5::Group & gp, Acoustics::FITKAcousticsLoadManager * LoadManager)
{
    if (LoadManager == nullptr)
    {
        return false;
    }
    std::tuple<bool, H5::Group>Ret = m_toolp->openGp(gp, "PowerSEAShell");//打开组
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group thisGroup = std::get<1>(Ret);

    std::tuple<bool, H5::Attribute>RetAttr = m_toolp->openAttribut(thisGroup, "PowerSEAShellCount"); //打开组个数属性
    if (std::get<0>(RetAttr) == false) { return false; }
    H5::Attribute CountAttrattr = std::get<1>(RetAttr);
    int count = -1;
    CountAttrattr.read(H5::PredType::NATIVE_INT, &count);


    for (int i = 0; i < count; ++i)
    {
        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->openGp(thisGroup, number.toStdString().data());//打开子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKLoadPowerSourcesSEAShell* ObjP = new Acoustics::FITKLoadPowerSourcesSEAShell;
        if (ObjP == nullptr)
        {
            return false;
        }
        //读父类数据
        this->readAcousticsAbstractLoad(subGroup, ObjP);

        //读子类数据
        int FlexureSpectraID = -1;//弯曲波频谱id
        int ShearSpectraID = -1;//剪切波频谱id
        int ExtensionSpectraID = -1;//拉伸波频谱id
        m_toolp->readGroupint(subGroup, "FlexureSpectraID", &FlexureSpectraID);
        m_toolp->readGroupint(subGroup, "ShearSpectraID", &ShearSpectraID);
        m_toolp->readGroupint(subGroup, "ExtensionSpectraID", &ExtensionSpectraID);

        ObjP->setFlexureSpectraID(FlexureSpectraID);
        ObjP->setShearSpectraID(ShearSpectraID);
        ObjP->setExtensionSpectraID(ExtensionSpectraID);

        LoadManager->appendDataObj(ObjP);
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::writePowerSEAShell(H5::Group & gp, QList<Acoustics::FITKAcousticsAbstractLoad*> data)
{
    const char *Path = "Load/PowerSEAShell";

    int count = data.size();//获取数据行数

    //在组下创建组，并为组附加数据个数属性
    m_toolp->CreateGroupAndAttr(gp, "PowerSEAShell", "PowerSEAShellCount", count);

    //获取刚刚创建的组
    H5::Group thisGroup = m_toolp->GetPathGroup(Path);

    for (int i = 0; i < count; ++i)
    {
        Acoustics::FITKLoadPowerSourcesSEAShell* ObjP = dynamic_cast<Acoustics::FITKLoadPowerSourcesSEAShell*>(data.at(i));
        if (ObjP == nullptr)
        {
            return false;
        }

        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->createGp(thisGroup, number.toStdString().data());//创建子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        //父类数据
        Acoustics::FITKAcousticsAbstractLoad* ObjParentP = dynamic_cast<Acoustics::FITKAcousticsAbstractLoad*>(ObjP);
        if (ObjParentP == nullptr)
        {
            return false;
        }
        this->writeAcousticsAbstractLoad(subGroup, ObjParentP);

        //本类数据
        int FlexureSpectraID = ObjP->getFlexureSpectraID();//弯曲波频谱id
        int ShearSpectraID = ObjP->getShearSpectraID();//剪切波频谱id
        int ExtensionSpectraID = ObjP->getExtensionSpectraID();//拉伸波频谱id
        m_toolp->writeGroupAttrInt(subGroup, "FlexureSpectraID", FlexureSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "ShearSpectraID", ShearSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "ExtensionSpectraID", ExtensionSpectraID);

    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::readPowerSEABeam(H5::Group & gp, Acoustics::FITKAcousticsLoadManager * LoadManager)
{
    if (LoadManager == nullptr)
    {
        return false;
    }
    std::tuple<bool, H5::Group>Ret = m_toolp->openGp(gp, "PowerSEABeam");//打开组
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group thisGroup = std::get<1>(Ret);

    std::tuple<bool, H5::Attribute>RetAttr = m_toolp->openAttribut(thisGroup, "PowerSEABeamCount"); //打开组个数属性
    if (std::get<0>(RetAttr) == false) { return false; }
    H5::Attribute CountAttrattr = std::get<1>(RetAttr);
    int count = -1;
    CountAttrattr.read(H5::PredType::NATIVE_INT, &count);


    for (int i = 0; i < count; ++i)
    {
        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->openGp(thisGroup, number.toStdString().data());//打开子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKLoadPowerSourcesSEABeam* ObjP = new Acoustics::FITKLoadPowerSourcesSEABeam;
        if (ObjP == nullptr)
        {
            return false;
        }
        //读父类数据
        this->readAcousticsAbstractLoad(subGroup, ObjP);

        //读子类数据
        int FlexureXSpectraID = ObjP->getFlexureXSpectraID();//弯曲波X频谱ID
        int FlexureYSpectraID = ObjP->getFlexureYSpectraID();//弯曲波Y频谱ID
        int ExtensionZSpectraID = ObjP->getExtensionZSpectraID();//拉伸波Z频谱ID
        int TorsionZZSpectraID = ObjP->getTorsionZZSpectraID();//扭转波ZZ频谱ID
        m_toolp->readGroupint(subGroup, "FlexureXSpectraID", &FlexureXSpectraID);
        m_toolp->readGroupint(subGroup, "FlexureYSpectraID", &FlexureYSpectraID);
        m_toolp->readGroupint(subGroup, "ExtensionZSpectraID", &ExtensionZSpectraID);
        m_toolp->readGroupint(subGroup, "TorsionZZSpectraID", &TorsionZZSpectraID);


        ObjP->setFlexureXSpectraID(FlexureXSpectraID);
        ObjP->setFlexureYSpectraID(FlexureYSpectraID);
        ObjP->setExtensionZSpectraID(ExtensionZSpectraID);
        ObjP->setTorsionZZSpectraID(TorsionZZSpectraID);

        LoadManager->appendDataObj(ObjP);
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::writePowerSEABeam(H5::Group & gp, QList<Acoustics::FITKAcousticsAbstractLoad*> data)
{
    const char *Path = "Load/PowerSEABeam";

    int count = data.size();//获取数据行数

    //在组下创建组，并为组附加数据个数属性
    m_toolp->CreateGroupAndAttr(gp, "PowerSEABeam", "PowerSEABeamCount", count);

    //获取刚刚创建的组
    H5::Group thisGroup = m_toolp->GetPathGroup(Path);

    for (int i = 0; i < count; ++i)
    {
        Acoustics::FITKLoadPowerSourcesSEABeam* ObjP = dynamic_cast<Acoustics::FITKLoadPowerSourcesSEABeam*>(data.at(i));
        if (ObjP == nullptr)
        {
            return false;
        }


        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->createGp(thisGroup, number.toStdString().data());//创建子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        //父类FITKLoadAbsPowerSources 没有数据，FITKLoadAbsPowerSources的父类FITKAcousticsAbstractLoad 有数据
        Acoustics::FITKAcousticsAbstractLoad* ObjParentP = dynamic_cast<Acoustics::FITKAcousticsAbstractLoad*>(ObjP);
        if (ObjParentP == nullptr)
        {
            return false;
        }
        this->writeAcousticsAbstractLoad(subGroup, ObjParentP);


        //本类数据
        int FlexureXSpectraID = ObjP->getFlexureXSpectraID();//弯曲波X频谱ID
        int FlexureYSpectraID = ObjP->getFlexureYSpectraID();//弯曲波Y频谱ID
        int ExtensionZSpectraID = ObjP->getExtensionZSpectraID();//拉伸波Z频谱ID
        int TorsionZZSpectraID = ObjP->getTorsionZZSpectraID();//扭转波ZZ频谱ID
        m_toolp->writeGroupAttrInt(subGroup, "FlexureXSpectraID", FlexureXSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "FlexureYSpectraID", FlexureYSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "ExtensionZSpectraID", ExtensionZSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "TorsionZZSpectraID", TorsionZZSpectraID);
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::readConstraintSEAAcoustic(H5::Group & gp, Acoustics::FITKAcousticsLoadManager * LoadManager)
{
    if (LoadManager == nullptr)
    {
        return false;
    }
    std::tuple<bool, H5::Group>Ret = m_toolp->openGp(gp, "ConstraintSEAAcoustic");//打开组
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group thisGroup = std::get<1>(Ret);

    std::tuple<bool, H5::Attribute>RetAttr = m_toolp->openAttribut(thisGroup, "ConstraintSEAAcousticCount"); //打开组个数属性
    if (std::get<0>(RetAttr) == false) { return false; }
    H5::Attribute CountAttrattr = std::get<1>(RetAttr);
    int count = -1;
    CountAttrattr.read(H5::PredType::NATIVE_INT, &count);


    for (int i = 0; i < count; ++i)
    {
        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->openGp(thisGroup, number.toStdString().data());//打开子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKLoadConstraintSEAAcoustic* ObjP = new Acoustics::FITKLoadConstraintSEAAcoustic;
        if (ObjP == nullptr)
        {
            return false;
        }
        //读父类数据
        this->readAcousticsAbstractLoad(subGroup, ObjP);

        //读子类数据
        int SpectraDataID = -1;//频谱ID

        m_toolp->readGroupint(subGroup, "SpectraDataID", &SpectraDataID);

        ObjP->setSpectraDataID(SpectraDataID);

        LoadManager->appendDataObj(ObjP);
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::writeConstraintSEAAcoustic(H5::Group & gp, QList<Acoustics::FITKAcousticsAbstractLoad*> data)
{

    const char *Path = "Load/ConstraintSEAAcoustic";

    int count = data.size();//获取数据行数

    //在组下创建组，并为组附加数据个数属性
    m_toolp->CreateGroupAndAttr(gp, "ConstraintSEAAcoustic", "ConstraintSEAAcousticCount", count);

    //获取刚刚创建的组
    H5::Group thisGroup = m_toolp->GetPathGroup(Path);

    for (int i = 0; i < count; ++i)
    {
        Acoustics::FITKLoadConstraintSEAAcoustic* ObjP = dynamic_cast<Acoustics::FITKLoadConstraintSEAAcoustic*>(data.at(i));
        if (ObjP == nullptr)
        {
            return false;
        }

        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->createGp(thisGroup, number.toStdString().data());//创建子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKAcousticsAbstractLoad* ObjParentP = dynamic_cast<Acoustics::FITKAcousticsAbstractLoad*>(ObjP);
        this->writeAcousticsAbstractLoad(subGroup, ObjParentP);//写父类数据

        //写本类数据
        int SpectraDataID = ObjP->getSpectraDataID();//频谱ID
        m_toolp->writeGroupAttrInt(subGroup, "SpectraDataID", SpectraDataID);

    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::readConstraintSEAShell(H5::Group & gp, Acoustics::FITKAcousticsLoadManager * LoadManager)
{
    if (LoadManager == nullptr)
    {
        return false;
    }
    std::tuple<bool, H5::Group>Ret = m_toolp->openGp(gp, "ConstraintSEAShell");//打开组
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group thisGroup = std::get<1>(Ret);

    std::tuple<bool, H5::Attribute>RetAttr = m_toolp->openAttribut(thisGroup, "ConstraintSEAShellCount"); //打开组个数属性
    if (std::get<0>(RetAttr) == false) { return false; }
    H5::Attribute CountAttrattr = std::get<1>(RetAttr);
    int count = -1;
    CountAttrattr.read(H5::PredType::NATIVE_INT, &count);


    for (int i = 0; i < count; ++i)
    {
        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->openGp(thisGroup, number.toStdString().data());//打开子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKLoadConstraintSEAShell* ObjP = new Acoustics::FITKLoadConstraintSEAShell;
        if (ObjP == nullptr)
        {
            return false;
        }
        //读父类数据
        this->readAcousticsAbstractLoad(subGroup, ObjP);

        //读子类数据
        int FlexureSpectraID = -1;//弯曲波频谱id
        int ShearSpectraID = -1;//剪切波频谱id
        int ExtensionSpectraID = -1;//拉伸波频谱id
        m_toolp->readGroupint(subGroup, "FlexureSpectraID", &FlexureSpectraID);
        m_toolp->readGroupint(subGroup, "ShearSpectraID", &ShearSpectraID);
        m_toolp->readGroupint(subGroup, "ExtensionSpectraID", &ExtensionSpectraID);

        ObjP->setFlexureSpectraID(FlexureSpectraID);
        ObjP->setShearSpectraID(ShearSpectraID);
        ObjP->setExtensionSpectraID(ExtensionSpectraID);

        LoadManager->appendDataObj(ObjP);
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::writeConstraintSEAShell(H5::Group & gp, QList<Acoustics::FITKAcousticsAbstractLoad*> data)
{
    //创建的HDF5目录结构
    const char *Path = "Load/ConstraintSEAShell";

    int count = data.size();//获取数据行数

    //在组下创建组，并为组附加数据个数属性
    m_toolp->CreateGroupAndAttr(gp, "ConstraintSEAShell", "ConstraintSEAShellCount", count);

    //获取刚刚创建的组
    H5::Group thisGroup = m_toolp->GetPathGroup(Path);

    for (int i = 0; i < count; ++i)
    {
        Acoustics::FITKLoadConstraintSEAShell* ObjP = dynamic_cast<Acoustics::FITKLoadConstraintSEAShell*>(data.at(i));
        if (ObjP == nullptr)
        {
            return false;
        }

        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->createGp(thisGroup, number.toStdString().data());//创建子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKAcousticsAbstractLoad* ObjParentP = dynamic_cast<Acoustics::FITKAcousticsAbstractLoad*>(ObjP);
        this->writeAcousticsAbstractLoad(subGroup, ObjParentP);//写父类数据

        //写本类数据
        int FlexureSpectraID = ObjP->getFlexureSpectraID();//弯曲波频谱id
        int ShearSpectraID = ObjP->getShearSpectraID();//剪切波频谱id
        int ExtensionSpectraID = ObjP->getExtensionSpectraID();//拉伸波频谱id

        m_toolp->writeGroupAttrInt(subGroup, "FlexureSpectraID", FlexureSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "ShearSpectraID", ShearSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "ExtensionSpectraID", ExtensionSpectraID);


    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::readConstraintSEABeam(H5::Group & gp, Acoustics::FITKAcousticsLoadManager * LoadManager)
{
    if (LoadManager == nullptr)
    {
        return false;
    }
    std::tuple<bool, H5::Group>Ret = m_toolp->openGp(gp, "ConstraintSEABeam");//打开组
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group thisGroup = std::get<1>(Ret);

    std::tuple<bool, H5::Attribute>RetAttr = m_toolp->openAttribut(thisGroup, "ConstraintSEABeamCount"); //打开组个数属性
    if (std::get<0>(RetAttr) == false) { return false; }
    H5::Attribute CountAttrattr = std::get<1>(RetAttr);
    int count = -1;
    CountAttrattr.read(H5::PredType::NATIVE_INT, &count);


    for (int i = 0; i < count; ++i)
    {
        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->openGp(thisGroup, number.toStdString().data());//打开子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKLoadConstraintSEABeam* ObjP = new Acoustics::FITKLoadConstraintSEABeam;
        if (ObjP == nullptr)
        {
            return false;
        }
        //读父类数据
        this->readAcousticsAbstractLoad(subGroup, ObjP);

        //读子类数据
        int FlexureXSpectraID = -1;//弯曲波X频谱ID
        int FlexureYSpectraID = -1;//弯曲波Y频谱ID
        int ExtensionZSpectraID = -1;//拉伸波Z频谱ID
        int TorsionZZSpectraID = -1;//扭转波ZZ频谱ID
        m_toolp->readGroupint(subGroup, "FlexureXSpectraID", &FlexureXSpectraID);
        m_toolp->readGroupint(subGroup, "FlexureYSpectraID", &FlexureYSpectraID);
        m_toolp->readGroupint(subGroup, "ExtensionZSpectraID", &ExtensionZSpectraID);
        m_toolp->readGroupint(subGroup, "TorsionZZSpectraID", &TorsionZZSpectraID);

        ObjP->setFlexureXSpectraID(FlexureXSpectraID);
        ObjP->setFlexureYSpectraID(FlexureYSpectraID);
        ObjP->setExtensionZSpectraID(ExtensionZSpectraID);
        ObjP->setTorsionZZSpectraID(TorsionZZSpectraID);


        LoadManager->appendDataObj(ObjP);
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::writeConstraintSEABeam(H5::Group & gp, QList<Acoustics::FITKAcousticsAbstractLoad*> data)
{
    //创建的HDF5目录结构
    const char *Path = "Load/ConstraintSEABeam";

    int count = data.size();//获取数据行数

    //在组下创建组，并为组附加数据个数属性
    m_toolp->CreateGroupAndAttr(gp, "ConstraintSEABeam", "ConstraintSEABeamCount", count);

    //获取刚刚创建的组
    H5::Group thisGroup = m_toolp->GetPathGroup(Path);

    for (int i = 0; i < count; ++i)
    {
        Acoustics::FITKLoadConstraintSEABeam* ObjP = dynamic_cast<Acoustics::FITKLoadConstraintSEABeam*>(data.at(i));
        if (ObjP == nullptr)
        {
            return false;
        }

        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->createGp(thisGroup, number.toStdString().data());//创建子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKAcousticsAbstractLoad* ObjParentP = dynamic_cast<Acoustics::FITKAcousticsAbstractLoad*>(ObjP);
        this->writeAcousticsAbstractLoad(subGroup, ObjParentP);//写父类数据

        //写子类数据
        int FlexureXSpectraID = ObjP->getFlexureXSpectraID();//弯曲波X频谱ID
        int FlexureYSpectraID = ObjP->getFlexureYSpectraID();//弯曲波Y频谱ID
        int ExtensionZSpectraID = ObjP->getExtensionZSpectraID();//拉伸波Z频谱ID
        int TorsionZZSpectraID = ObjP->getTorsionZZSpectraID();//扭转波ZZ频谱ID
        m_toolp->writeGroupAttrInt(subGroup, "FlexureXSpectraID", FlexureXSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "FlexureYSpectraID", FlexureYSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "ExtensionZSpectraID", ExtensionZSpectraID);
        m_toolp->writeGroupAttrInt(subGroup, "TorsionZZSpectraID", TorsionZZSpectraID);

    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::writeImportNoiseHVACs(H5::Group &gp, QList<Acoustics::FITKAcousticsAbstractLoad*> data)
{
    //创建的HDF5目录结构
    const char *Path = "Load/ImportNoiseHVAC";

    int count = data.size();;//获取数据行数

    //在组下创建组，并为组附加数据个数属性
    m_toolp->CreateGroupAndAttr(gp, "ImportNoiseHVAC", "ImportNoiseHVACCount", count);

    //获取刚刚创建的组
    H5::Group thisGroup = m_toolp->GetPathGroup(Path);

    for (int i = 0; i < data.size(); ++i)
    {
        Acoustics::FITKLoadNoiseHVAC* ObjP = dynamic_cast<Acoustics::FITKLoadNoiseHVAC*>(data.at(i));
        if (ObjP == nullptr)
        {
            return false;
        }


        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->createGp(thisGroup, number.toStdString().data());//创建子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKAcousticsAbstractLoad* ObjParentP = dynamic_cast<Acoustics::FITKAcousticsAbstractLoad*>(ObjP);
        this->writeAcousticsAbstractLoad(subGroup, ObjParentP);//写父类数据

        //特化数据
        QString FilePath = ObjP->getFilePath();
        m_toolp->writeGroupAttrStr(subGroup, "FilePath", FilePath.toStdString());
    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::readImportNoiseHVACs(H5::Group & gp, Acoustics::FITKAcousticsLoadManager * LoadManager)
{
    if (LoadManager == nullptr)
    {
        return false;
    }
    std::tuple<bool, H5::Group>Ret = m_toolp->openGp(gp, "ImportNoiseHVAC");//打开组
    if (std::get<0>(Ret) == false) { return false; }
    H5::Group thisGroup = std::get<1>(Ret);

    std::tuple<bool, H5::Attribute>RetAttr = m_toolp->openAttribut(thisGroup, "ImportNoiseHVACCount"); //打开组个数属性
    if (std::get<0>(RetAttr) == false) { return false; }
    H5::Attribute CountAttrattr = std::get<1>(RetAttr);
    int count = -1;
    CountAttrattr.read(H5::PredType::NATIVE_INT, &count);

    for (int i = 0; i < count; i++)
    {
        QString number = QString::number(i);
        std::tuple<bool, H5::Group>Ret = m_toolp->openGp(thisGroup, number.toStdString().data());//打开子节点
        if (std::get<0>(Ret) == false) { return false; }
        H5::Group subGroup = std::get<1>(Ret);

        Acoustics::FITKLoadNoiseHVAC* ObjP = new Acoustics::FITKLoadNoiseHVAC;

        //读父类
        this->readAcousticsAbstractLoad(subGroup, ObjP);

        //读子类
        std::string FilePath;
        m_toolp->readGroupStr(subGroup, "FilePath", FilePath);

        ObjP->setFilePath(QString::fromStdString(FilePath));

        LoadManager->appendDataObj(ObjP);

    }
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::writeAcousticsAbstractLoad(H5::Group & gp, Acoustics::FITKAcousticsAbstractLoad * PaentP)
{
    //FITKAcousticsAbstractLoad载荷的导入数据的抽象类数据
    bool EnabledState = PaentP->getEnabledState();//启用状态
    QString Notes = PaentP->getNotes();//注释信息
    m_toolp->CheckString(Notes);
    int ConnectionObjID = PaentP->getConnectionObjID();//连接对象ID
    double ConnectionLocation[3]{ 0.0,0.0,0.0 };
    PaentP->getConnectionLocation(ConnectionLocation);//连接位置{x,y,z}
    std::vector<double>ConnectionLocationVec;
    ConnectionLocationVec.push_back(ConnectionLocation[0]);
    ConnectionLocationVec.push_back(ConnectionLocation[1]);
    ConnectionLocationVec.push_back(ConnectionLocation[2]);

    m_toolp->writeGroupAttrBool(gp, "EnabledState", EnabledState);
    m_toolp->writeGroupAttrStr(gp, "Notes", Notes.toStdString());
    m_toolp->writeGroupAttrInt(gp, "ConnectionObjID", ConnectionObjID);
    m_toolp->CreateOneDarrayDataSetDouble(gp, "ConnectionLocation", ConnectionLocationVec);



    //FITKAcousticsAbstractLoad及其父类数据
    QString DataObjectName = PaentP->getDataObjectName();
    int DataObjectID = PaentP->getDataObjectID();

    m_toolp->writeGroupAttrStr(gp, "DataObjectName", DataObjectName.toStdString());
    m_toolp->writeGroupAttrInt(gp, "DataObjectID", DataObjectID);
    return true;
}

bool IO::FITKAcousticsLoadMgrAdaptor::readAcousticsAbstractLoad(H5::Group & gp, Acoustics::FITKAcousticsAbstractLoad * PaentP)
{
    //FITKAcousticsAbstractLoad载荷的导入数据的抽象类数据
    bool EnabledState = false;//启用状态
    std::string Notes = "";//注释信息
    int ConnectionObjID = -1;//连接对象ID
    double ConnectionLocation[3]{ 0.0,0.0,0.0 };//连接位置{x,y,z}
    std::vector<double>ConnectionLocationVec;

    m_toolp->readGroupBool(gp, "EnabledState", &EnabledState);
    m_toolp->readGroupStr(gp, "Notes", Notes);
    m_toolp->readGroupint(gp, "ConnectionObjID", &ConnectionObjID);
    m_toolp->ReadOneDArrayDataSetDouble(gp, "ConnectionLocation", ConnectionLocationVec);

    PaentP->setEnabledState(EnabledState);
    QString NotesQ = QString::fromStdString(Notes);
    m_toolp->RestoreString(NotesQ);
    PaentP->setNotes(NotesQ);
    PaentP->setConnectionObjID(ConnectionObjID);

    if (ConnectionLocationVec.size() == 3)
    {
        ConnectionLocation[0] = ConnectionLocationVec.at(0);
        ConnectionLocation[1] = ConnectionLocationVec.at(1);
        ConnectionLocation[2] = ConnectionLocationVec.at(2);
    }
    PaentP->setConnectionLocation(ConnectionLocation);


    //FITKAcousticsAbstractLoad及其父类数据
    std::string DataObjectName = "";
    int DataObjectID = -1;

    m_toolp->readGroupStr(gp, "DataObjectName", DataObjectName);
    m_toolp->readGroupint(gp, "DataObjectID", &DataObjectID);

    QString temp = QString::fromStdString(DataObjectName);

    m_toolp->RestoreString(temp);
    PaentP->setDataObjectName(temp);

    Core::FITKAbstractDataIDAlter a;
    a.modifyDataID(PaentP, DataObjectID);

    return true;
}
